﻿using SQLite.DbEntities;
using SQLite.Reps.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SQLite.Reps
{
    public class WordRep : Rep<WordDbEntity>
    {
        public WordRep(SQLiteAsyncConnection con) : base(con)
        {
        }

        public async Task<WordDbEntity> FindByIdAsync(Guid id)
        {
            return await _connection.FindAsync<WordDbEntity>(id);
        }

        public async Task<List<WordDbEntity>> GetByDictionaryId(Guid dictionaryId)
        {
            var sqlSelectCommand = String.Format("Select * From {0} where FK_CircleId = '{1}'", TableName, dictionaryId);
            return await _connection.QueryAsync<WordDbEntity>(sqlSelectCommand);
        }
    }
}
